feat(bindings/nodejs): Add DeleteOptions support for new options API#6349
Merged
Xuanwo merged 1 commit intoapache:mainfrom Jul 11, 2025
Merged
feat(bindings/nodejs): Add DeleteOptions support for new options API#6349Xuanwo merged 1 commit intoapache:mainfrom
Xuanwo merged 1 commit intoapache:mainfrom
Conversation
asukaminato0721
approved these changes
Jul 1, 2025
Member
|
Hi, this PR LGTM to me. I will let Copilot in to see how it works. |
There was a problem hiding this comment.
Pull Request Overview
Adds support for versioned delete options in the Node.js bindings and updates tests and capabilities accordingly.
- Defines a N-API
DeleteOptionsstruct with conversion to the Rustopendal::options::DeleteOptions. - Extends
Operatormethods (delete/delete_sync) to accept optional delete options. - Introduces
delete_with_versioncapability and adds corresponding async/sync test suites.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| bindings/nodejs/src/options.rs | Added N-API DeleteOptions struct and From impl |
| bindings/nodejs/src/lib.rs | Updated delete/delete_sync to accept delete options |
| bindings/nodejs/src/capability.rs | Added delete_with_version getter |
| bindings/nodejs/tests/suites/asyncDeleteOptions.suite.mjs | New async delete options tests |
| bindings/nodejs/tests/suites/syncDeleteOptions.suite.mjs | New sync delete options tests |
| bindings/nodejs/tests/suites/index.mjs | Registered the new delete options test suites |
Comments suppressed due to low confidence (5)
bindings/nodejs/tests/suites/syncDeleteOptions.suite.mjs:31
- The suite title is incorrect for synchronous tests. Rename 'async delete options' to 'sync delete options' to reflect the correct context.
describe.runIf(capability.write && capability.delete)('async delete options', () => {
bindings/nodejs/tests/suites/syncDeleteOptions.suite.mjs:88
- This test does not assert the outcome of deleting with a non-existing version. Consider adding an assertion (e.g.,
assert.isTrue(op.existsSync(filename2))) to verify the file was not deleted.
op.deleteSync(filename2, { version })
bindings/nodejs/tests/suites/asyncDeleteOptions.suite.mjs:88
- There is no assertion confirming that the file remains after a delete with a non-matching version. Add something like
assert.isTrue(await op.exists(filename2))after this line.
await op.delete(filename2, { version })
bindings/nodejs/tests/suites/syncDeleteOptions.suite.mjs:81
- This references
filename, which is undefined in this scope. It should usefilename1to retrieve the metadata.
const meta = op.statSync(filename)
bindings/nodejs/tests/suites/asyncDeleteOptions.suite.mjs:81
filenameis undefined here; you likely meantfilename1to get the metadata for the first file.
const meta = await op.stat(filename)
Xuanwo
reviewed
Jul 4, 2025
fd7c3ff to
ecedccc
Compare
ecedccc to
cb4b551
Compare
Member
|
Thank you @kingsword09 for working on this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Related to #6281.
Rationale for this change
This PR adds support for opendal::options::DeleteOptions conversion in the nodejs bindings. This is part of the migration to the new options API outlined in RFC-6213 (#6213).
What changes are included in this PR?
Are there any user-facing changes?
Yes, users can now add options to their delete requests